/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.service;


import me.zhengjie.pojo.InBoundInfo;
import me.zhengjie.pojo.PPOutBoundInvertoryUI;
import me.zhengjie.pojo.Resp;
import me.zhengjie.pojo.StringPPInfo;
import me.zhengjie.pojo.sqlServer.PPInfo;
import me.zhengjie.pojo.sqlServer.PPInventory;
import me.zhengjie.service.dto.PPInfoDto;
import me.zhengjie.service.dto.PPInfoQueryCriteria;
import me.zhengjie.service.dto.PPInventoryDto;
import me.zhengjie.service.dto.PPOutboundOrderDetailQueryCriteria;
import me.zhengjie.utils.PageResult;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletResponse;
import javax.transaction.Transactional;
import java.io.IOException;
import java.util.List;

/**
* @website https://eladmin.vip
* @description 服务接口
* @author xinglin
* @date 2024-08-03
**/
public interface PPInfoService {

    /**
    * 查询数据分页
    * @param criteria 条件
    * @param pageable 分页参数
    * @return Map<String,Object>
    */
//    PageResult<PPInfoDto> queryAll(PPInfoQueryCriteria criteria, Pageable pageable);
    PageResult<PPOutBoundInvertoryUI> queryAll(PPInfoQueryCriteria criteria, Pageable pageable);


    //连表查询
    PageResult<PPInventoryDto> queryAllbyjoin(PPInfoQueryCriteria criteria, Pageable pageable);


    PageResult<PPOutBoundInvertoryUI> queryAllByOrderDetails(PPOutboundOrderDetailQueryCriteria criteria, Pageable pageable, Integer orderId);


    /**
    * 查询所有数据不分页
    * @param criteria 条件参数
    * @return List<PpInfoDto>
    */
    List<PPInfoDto> queryAll(PPInfoQueryCriteria criteria);

    /**
     * 根据ID查询
     * @param id ID
     * @return PpInfoDto
     */
    PPInfoDto findById(Integer id);

    /**
    * 创建
    * @param resources /
    */
    void create(PPInfo resources);

    /**
    * 编辑
    * @param resources /
    */
    void update(PPInfo resources);

    /**
    * 多选删除
    * @param ids /
    */
    void deleteAll(Integer[] ids);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    void download(List<PPInfoDto> all, HttpServletResponse response) throws IOException;


    @Transactional
    void saveOrUpdatePPInfo(PPInfo ppInfo);

    PPInfo queryById(Integer id);

    PPInfo queryByPalletCode(String palletCode);

    Resp saveOrUpdate(InBoundInfo inBoundInfo);

//    List<PPInfo> findByPpBatch(List<String> PpBatchs);

    String validatePPInfo(InBoundInfo inBoundInfo);

    PPInfo transformInfo(StringPPInfo stringPPInfo);
}